<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib uri="/struts-tags" prefix="s"%>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<script src="<%=request.getContextPath() %>/jsFile/um/cached_report.js" type="text/javascript"></script>
<script src="<%=request.getContextPath() %>/jsFile/um/cached_report_cus.js" type="text/javascript"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/jsFile/um/dialog.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/jsFile/um/click.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/jsFile/um/rum.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/jsFile/um/insight.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/jsFile/um/ga.js"></script>
<%-- <script type="text/javascript">var _menus ={<%=request.getSession().getAttribute("sbAccroinaccordionMenu")%>};</script> --%>


<script type="text/javascript">
		//load tree list li += '<li><a href="'+title.menus[i].url+'" class=" click">'+title.menus[i].menuname+'</a></li>';
		$(function() {
			  var tree = $("#tree");
			  $.ajax({
					url:urls,
					type : "POST",
					cache : false, 
					async : true,
				    dataType:'html',
				    success:function(data){
				   	var obj = eval('(' + data + ')');
				   		$.each( obj, function(idx, e){
				   			$.each( e.head, function(id, ex){
				   			 tree.append('<h2 class="l_m_controls has_son_menu">'+ex.menuname+'</h2>');
				   				var li='';
				   				$.each( ex.menus, function(id, menu){
				   					
				   					 var url=menu.url;
					   				 if(/=/.test(url)){
					   					 url=url+'&code='+menu.code;
					   				 }else{
					   					 url=url+'?code='+menu.code;
					   				 }
				   					li += '<li><a onclick=gogogo("'+url+'") style="cursor:pointer">'+menu.menuname+'</a></li>';
				   				});
				   				 tree.append('<div class="pane_con"><ul>'+li+'</ul></div>');
				   			});
				   		});
				    },
				    error:function(){ 
				    	alert("请先登录");
				    },
			 });
	/* 		  for (var name in _menus){
					 var title = _menus[name][0];
					 tree.append('<h2 class="l_m_controls has_son_menu">'+title.menuname+'</h2>');
					 var li = '';
					 var count = title.menus.length;
					 for(var i = 0; i < count; i++){
						 var url =title.menus[i].url;
						 if(/=/.test(url)){
							 url=url+'&code='+title.menus[i].code;
						 }else{
							 url=url+'?code='+title.menus[i].code;
						 }
						 li += '<li><a onclick=gogogo("'+url+'") class=" click">'+title.menus[i].menuname+'</a></li>';
					 }
					 tree.append('<div class="pane_con"><ul>'+li+'</ul></div>');
				} */
		})
		function gogogo(url){
			var frame = document.getElementById("contentFrame");
			frame.src= url.indexOf("/")==0 ? '<%=request.getContextPath() %>'+url : '<%=request.getContextPath() %>/'+url;
		}

      $(function() {
		  /// tip notice function
		  $('.icon-notice').bind('click',function(){
		  	if($('.tip-contentpanel').hasClass('hide')){
		  		$('.tip-contentpanel').removeClass('hide');
		  	}else{
		  		$('.tip-contentpanel').addClass('hide');
		  	}
			return false;
		  })
		  ///
        if ((cookie_get('tip_closed') == 'true')) {
          $(".b_home_tips").hide();
          $('#b_center').removeAttr('style');
          $('body').removeAttr('style');
        };
        //新select样式 --begin
        $('body').delegate('.select_arrow,.selected_value','click',function(e){
        	e.stopPropagation();
          $(this).nextAll('.select_list_body').slideToggle(200);
        });

        $(document).click(function(e){
        	e.stopPropagation();
        	 if($(e.target).is(".compared_date_select")||$(e.target).closest('.compared_date_select').length>0||$(e.target).closest('.select_option').length>0||$(e.target).closest('#calroot').length>0){//calroot
        	 	return false;
        	 }
        	$('.select_list_body').slideUp(200);
        });
        $('body').delegate('.select_list_body ul li.date_picker','click',function(e){
        	e.stopPropagation();
        	$(this).next('li').slideToggle(200);
        	
        });
        
        //左侧菜单切换
        $.tools.tabs.addEffect("slide", function(i, done) {
          this.getPanes().slideUp().css({backgroundColor: "#fff"});
          this.getPanes().eq(i).slideDown(function() {
            $(this).css({backgroundColor: 'transparent'});
            done.call();
          });
        });
        $(".accordion").tabs(".accordion div.pane_con", {tabs: 'h2.l_m_controls', effect: 'slide', initialIndex: null});

        $(".accordion .l_m_controls").removeClass("current");
        //根据当前导航菜单，取得当前连接的外围，将其显示
        var a_c = $(".b_leftmenu .accordion").find("a.current");
        $(a_c).parent().parent().parent().show();
        $(a_c).parent().parent().parent().prev(".l_m_controls").addClass("current");

        $(".enent_son_menu_wrap").hide();
        $("a.event_show").hover(function() {
          var e_h = $(".enent_son_menu_wrap").height();
          $(".enent_son_menu_wrap").css("top", -e_h + 22);
          $(".pane_con a").removeClass("current");
          $(this).addClass("current");
        });

        var option_l = $('select.ltselect option').length;
        if (option_l > 0) {
          $('select.ltselect').tzSelect();
        };

       
        var evs=[" introBook","1112","111","wendi-name","9527","BookRead","BookRead","BookStore","BookStore","a","atest","autoImport","bookStoreDown","bookStoreDown","booksNumberInTime","booksNumberOutOfTime","detail_click","detail_click","detail_impression","detail_impression","广告点击","domob_click","关闭广告","domob_close","广告请求失败","domob_fail","广告wap页","domob_landing_page","页面显示","domob_page_show","广告显示","domob_show","download","emptyBookshelves","firstMenu","home_click","home_click","123123","introBook","introBook1","test","introbook","popMenu","search","secondMenu","tt","test","typeDown","typeDown","xxClick","xxClose","xxFail","xxLand","xxShow"];
        var sev = $("#search_event_val");
        sev.autocomplete({
          delimiter: /(,|;)\s*/,
          noCache: false,
          width: 171,
          onSelect: function(value, data){
            window.location.href="/apps/a20000aac57fc2112a949bd4/events/dashboard?name="+value;
          },
          lookup:evs 
        });
        var text = $("#search_event").val();
        if(text==""){
          text="事件名称";
        }
        sev.val(text);
        sev.css("color","grey");
        sev.blur(function(){
          $("#search_event").val(sev.val());
        });
        sev.focus(function(){
          sev.css("color","black");
          sev.val('');
        });
  });
    </script>

    <div class="fl b_leftmenu">
	    <div>
	      <div class="accordion" id="tree">  </div>
	    </div>
          <div class="kong35"></div>
    </div>
